Title Banner

Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Printing Extensions and Drivers /
Chapter 6 - Printing Resources / Printing Resources Reference
Resources Used for Printing Extensions and Printer Drivers


The Status ('stat') Resource

You need to include a status resource, of type statusType, to define the status messages that are displayed during the printing process. The driver forces status messages to be displayed by calling either the GXReportStatus function (for simple messages) or the GXAlertTheUser function (for messages that require user attention).

Figure 6-2 shows the structure of the status resource.

Figure 6-2 The status resource

The status resource contains a count of the status entries and an array of status definitions.

Each status definition contains four values:

Most of the status types produce side effects. For example, if you send a status message with status type gxSpoolingPageStatus, the page count is incremented in the spooling status that is displayed on the user's screen. Table 6-3 shows the status type constants and the side effects associated with each.
Table 6-3 Status types
ConstantValueExplanation of side effects
gxNonFatalError1Affects the icon that is displayed during spooling
gxFatalError2Displays a printing alert during spooling
gxPrinterReady3Signals that alert mode is done
gxUserAttention4Signals initiation of a modal alert
gxUserAlert5Signals initiation of a printing alert
gxPageTransmission6Signals that a page has been sent to the printer and increments the printed page count
gxOpenConnectionStatus7Signals that animation of the printer icon is to begin
gxInformationalStatus8Displays an informational status message with no side effects
gxSpoolingPageStatus9Signals that a page has been spooled and increments the spooled page count
gxEndStatus10Signals the end of spooling
gxPercentageStatus11Signals the percentage of the current print job that is currently complete

Listing 6-3 shows an example of a status resource.

Listing 6-3 An example of a status resource

#define kDrvrCreatorType 'IWII'

resource statusType (kDriverStatus, sysHeap, purgeable)
{
   kDrvrCreatorType,
   {
   gxInformationalStatus, 1, 0, "Sending data to printer";
   gxUserAlert, 1, kDriverStatus,
                     "Please check that the printer is on-line";
   };
};
Listing 6-3 defines a status resource for the ImageWriter II printer driver. This resource defines two status text strings. The first text string is an informational message that does not require a printing alert box and is displayed in the desktop printer window. The second text string requires user attention and is displayed in a printing alert box.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996




Navigation graphic, see text links

Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help